/*
 * @Author: w
 * @Date: 2022-02-22 22:52:09
 * @Description: 剑指 Offer 11. 旋转数组的最小数字
 */

// 二分查找

/**
 * @param {number[]} numbers
 * @return {number}
 */

// 遍历
var minArray = function (numbers) {
  for (let i = 0; i < numbers.length - 1; i++) {
    if (numbers[i + 1] < numbers[i]) {
      return numbers[i + 1];
    }
  }
  return numbers[0];
};

// es6
var minArray = function (numbers) {
  return Math.min(...numbers);
};
